window.onload = function(){
	//获取广告主近30日花费情况
	var param1 = "/agency/aginfor/adconstsitua";
	var method1 = "post";
	var datas1 = {page:1,pageSize:2};
	getAgentMsg(param1,method1,datas1);
//	console.log(dataResult);
	var html1 = "";
	for(var u=0;u<dataResult.data.length;u++){
		html1 += '<tr><td>'+dataResult.data[u].adTime+'</td>';
		html1 += '<td>'+dataResult.data[u].adCost+'</td>';
		html1 += '<td>'+dataResult.data[u].adExposure+'</td>';
		html1 += '<td>'+dataResult.data[u].cmp+'</td></tr>';
	}
//	html1 += '<tr><td colspan="99"><a class="getAdvCount" href="javascript:getAdvCount();">点击加载更多...</a></td></tr>';
	$(".costSituation").append(html1);
	
	//获取广告主近30日花费
	var param2 = "/agency/aginfor/showAdCost";
	var method2 = "post";
	
	getAgentMsg2(param2,method2);
//	console.log(dataResult2);
	var html2 = "";
	for(var u=0;u<dataResult2.data.length;u++){
		html2 += '<tr><td>'+dataResult2.data[u].adComapyName+'</td>';
		html2 += '<td>'+dataResult2.data[u].adCost+'</td></tr>';
	}
//	html2 += '<tr><td colspan="99"><a class="getAdvCount" href="javascript:getAdvCount();">点击加载更多...</a></td></tr>';
	$(".costSituationB").append(html2);
	
	//首页信息
	
	var param3 = "/agency/aginfor/showInfo";
	var method3 = "post";
	
	
	getAgentMsg3(param3,method3);
//	console.log(dataResult3.data);
	var actAdNum = dataResult3.data.actAdNum;//活跃广告主数量
	var adNum = dataResult3.data.adNum;//广告主数量
	var dshNum = dataResult3.data.dshNum;//待审核广告主数量
	var agAuctCost = dataResult3.data.today.agAuctCost;//本日竞价交易当日花费
	var agAuctCostz = dataResult3.data.yesterday.agAuctCost;//本日竞价交易当日花费
	var agAuctCostq = dataResult3.data.eve.agAuctCost;//本日竞价交易当日花费
	//var agAuctProfit = dataResult3.data.today.agAuctProfit;//竞价交易当日利润
	//var agAuctProfitMargin = dataResult3.data.today.agAuctProfitMargin;//竞价交易当日利润率
	var agContractCost = dataResult3.data.today.agContractCost;//合约交易当日花费
	var agContractCostz = dataResult3.data.yesterday.agContractCost;//合约交易当日花费
	var agContractCostq = dataResult3.data.eve.agContractCost;//合约交易当日花费
	
	//var agContractIncome = dataResult3.data.today.agContractIncome;//合约交易当日收入
	//var agContractProfit = dataResult3.data.today.agContractProfit;//合约交易当日利润
	//var agContractProfitMargin = dataResult3.data.today.agContractProfitMargin;//合约交易当日利润率
	
	
	$('.agAuctCost').text(agAuctCost);
	$('.agAuctCostz').text(agAuctCostz);
	$('.agAuctCostq').text(agAuctCostq);
	$('.adNum').text(adNum);
	$('.actAdNum').text(actAdNum);
	$('.dshNum').text(dshNum);
	$('.agContractCost').text(agContractCost);
	$('.agContractCostz').text(agContractCostz);
	$('.agContractCostq').text(agContractCostq);
}
